Content starts here Cast Using a Built-In XQuery Function
This page last changed on Feb 26, 2008.

eDocs Home > BEA AquaLogic Data Services Platform Documentation > Data Services Developer's Guide > Contents

How To Cast Using a Built-In XQuery Function

This topic describes how to use a built-in XQuery function to cast values of different data types in an update map.

Example

You can cast an element from one data type to another using a built-in XQuery cast function when:

  • Type promotion does not occur.
  • The data comes from a variable or an other source that is not a constant
  • A built-in function that performs the cast you want is available in the Design Palette. 

To cast using a built-in XQuery function:

  1. Click the Update Map tab.
  2. Click the disabled element in an update block on the left.
    In the expression editor, you see an expression that uses fn-bea:value() to map from the return type on the right, for example:
    fn-bea:value($CUSTOMER/CUSTOMER_SINCE)

    This expression represents a dateTime value coming from the return type.

  3. Open the Design Palette
    Window > Show View > Design Palette
  4. Expand XQuery Functions, then a category (for example, Duration, Date, and Time Functions).
  5. Drag the function you want to the expression editor (for example, fn-bea:date-from-dateTime), leaving the existing expression there.
  6. If feasible, use the existing expression as an argument to the function, for example:
    fn-bea:date-from-dateTime( fn-bea:value($CUSTOMER/CUSTOMER_SINCE) )

    Here the original value is used as the $dateTime argument to fn-bea:date-from-dateTime().

  7. Test the update map cast to make sure it works as you expect.

See Also

Concepts
How To
Other Resources



Document generated by Confluence on Apr 28, 2008 15:57